package me.leiusual.sharing.ui.mine.adapter

import android.view.View
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.extensions.LayoutContainer
import kotlinx.android.synthetic.main.view_holder_mine_renew.*
import me.leiusual.sharing.api.model.userrenew.RenewHistory
import me.leiusual.sharing.util.extension.toSpanned

/**
 * author: leiusual
 * create on: 2019-08-14
 * description:
 */
class MineRenewViewHolder(
    override val containerView: View
) : RecyclerView.ViewHolder(containerView), LayoutContainer {

  fun bind(renewHistory: RenewHistory) {

    val builder = StringBuilder()
    builder.append("""${renewHistory.businessName}（当前级别：${renewHistory.businessLevel}）""")
    builder.append("""<br/>${renewHistory.amount}""")
    builder.append("""<br/>${renewHistory.createTime}""")
    text_view.text = builder.toString().toSpanned()
  }
}